<template>
  <div class="container">
    <DataList
      ref="dataList"
      :propAutoFetchData="true"
      :propNoCheck="true"
      :propSearchFields="['busKey','oprtName','patientName']"
      :propSearchTextAppend="'单号/手术名称/病人名称'"
      propUrl="/settlement/dept_oprt_uses/pageCommon"
      showFieldMain="busKey"
      showValueMain="rightMsg"
      showFieldPk="id"
      :isOnlyShow="true"
      :showFieldList="showFieldList"
      :showDataFmtFun="showDataFmtFun"
      :vanFieldLabelWith5="true"
    >
    </DataList>
  </div>
</template>

<script>

export default {
  help: '高值消耗-列表',
  data() {
    return {
      activeNames: ['1'],
      showFieldList: [
        { label: '手术名称', name: 'oprtName', span: 24 },
        { label: '手术日期', name: 'oprtDate', span: 12 },
        { label: '手术单号', name: 'oprtCode', span: 12 },
        { label: '病人名称', name: 'patientName', span: 12 },
        { label: '住院编号', name: 'patientNo', span: 12 },
        { label: '床位号', name: 'bedNo', span: 12 },
        { label: '主治医生', name: 'docNameSug', span: 12 },
        { label: '申请医生', name: 'docNameApply', span: 12 },
        { label: '住院号', name: 'inpatientNo', span: 12 },
        { label: '门诊号', name: 'outpatientNo', span: 12 },
        { label: '金额', name: 'amount', span: 12 },
      ]
    }
  },
  methods: {
    showDataFmtFun(data) {
      data.forEach(item => {
        if ([true,1].includes(item.flagUseRedType)) {
          item.rightMsg = `<span style="margin-right: 5px">${item.busDate}</span><span style="background-color: #2ba471; color: #fff;padding: 3px;">退费</span>`
        }else {
          item.rightMsg = `<span style="margin-right: 5px">${item.busDate}</span><span style="background-color: #993333; color: #fff;padding: 3px;">计费</span>`
        }
      })
      return data
    }
  }
}
</script>
